/* GSStocksBalanUpInitAction.java
 *
 * Project/Product: JZCG-XMBUS
 *
 * Modify Information:
 * =============================================================================
 *   Author	Date       Description
 *   ----------	---------- ---------------------------------------------------
 *   peng.ning	2008-9-2	First release
 *
 * Licensed Materials - Property of APEP
 * =============================================================================
 *    (C) COPYRIGHT Shanghai Auto Mart E-Procurement Co., Ltd. 2007 - 2008
 *    All Rights Reserved.
 *
 *    This software is the confidential and proprietary information of
 *    Shanghai Auto Mart E-Procurement Co., Ltd. ("Confidential Information").
 *    You shall not disclose such Confidential Information and shall use it only
 *    in accordance with the terms of the license agreement you entered into 
 *    with Shanghai Auto Mart E-Procurement Co., Ltd.
 *
 * Noties:
 * =============================================================================
 * 
 */

package com.hitrust.gs.action;

import com.hitrust.gs.bean.GSOrganizationBean;
import com.hitrust.gs.bean.GSProviderBean;
import com.hitrust.gs.bean.GSStocksBean;
import com.hitrust.gs.bean.GSStocksDetailBean;
import com.hitrust.gs.business.GSOrganizationProcessor;
import com.hitrust.gs.business.GSProviderProcessor;
import com.hitrust.gs.business.GSStocksProcesser;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;
//import com.sun.rsasign.af;

public class GSStocksBalanUpInitAction extends GSBaseAction {
    private GSStocksProcesser spro=new GSStocksProcesser();
    private GSProviderProcessor ppro=new GSProviderProcessor();
    /* (non-Javadoc)
     * @see com.hitrust.gs.service.GSBaseAction#execute(com.hitrust.gs.service.GSBaseForm)
     */
    public String execute(GSBaseForm aForm) throws Exception {
        // TODO Auto-generated method stub
        String did=aForm.getRequest().getParameter("did");
        //取得领用明细信息
        GSStocksDetailBean dbean=spro.getStocksDetailByDid(did);
        //取得领用单信息
        GSStocksBean sbean=spro.getStocksBySid(dbean.getGs_stocks_id());
        //供应商信息
        GSProviderBean pbean=ppro.getProviderById(dbean.getGs_provider_id());
        
        aForm.getRequest().setAttribute("dbean", dbean);
        aForm.getRequest().setAttribute("sbean", sbean);
        aForm.getRequest().setAttribute("pbean",pbean);
        //出货单位名称
        GSOrganizationBean orgbean=GSOrganizationProcessor.getOrg(sbean.getGs_shipment_id());
        aForm.getRequest().setAttribute("orgbean",orgbean);
        return GSBaseConstants.FORWARD_SUCCESS;
    }

}
